@extends('layout.home')

@section('title','商品列表')

@section('content')
<style type="text/css">
	.goods{
		margin-bottom:30px;
	}
</style>
<!--content-->
<div class="products">
	<div class="container">
		
		<div class="col-md-9">
			<div class="content-top1">
			@foreach($data as $k=>$v)
				<div class="col-md-4 goods">
					<div class="col-md1 simpleCart_shelfItem">
						<a href="/home/detail/{{$v->id}}.html?goods_id={{$v->id}}">
							<img class="img-responsive" src="{{$v->path}}" alt="" />
						</a>
						<h3><a href="/home/detail/{{$v->id}}.html?goods_id={{$v->id}}">{{$v->title}}</a></h3>
						<div class="price">
								<h5 class="item_price">{{$v->price}}</h5>
								<a href="/home/detail/{{$v->id}}.html" class="item_add">添加购物车</a>
								<div class="clearfix"> </div>
						</div>
					</div>
				</div>	
			@endforeach
			
			<!-- <div class="clearfix"> </div> -->
			</div>	
			{!! $data->render() !!}
			<!-- <div class="clearfix"> </div> -->
				
		</div>
	
				<script type="text/javascript">
					$(function() {
					    var menu_ul = $('.menu-drop > li > ul'),
					           menu_a  = $('.menu-drop > li > a');
					    menu_ul.hide();
					    menu_a.click(function(e) {
					        e.preventDefault();
					        if(!$(this).hasClass('active')) {
					            menu_a.removeClass('active');
					            menu_ul.filter(':visible').slideUp('normal');
					            $(this).addClass('active').next().stop(true,true).slideDown('normal');
					        } else {
					            $(this).removeClass('active');
					            $(this).next().stop(true,true).slideUp('normal');
					        }
					    });
					
					});
				</script>

				
			<div class="col-md-3 product-bottom " id="fixed_side" style="top:20px;right:0px;">
				 <div class="product-bottom">
                <h3 class="cate">
                    本周热卖
                </h3>
                @foreach($arr as $k=>$v)
                <div class="product-go">
                    <div class=" fashion-grid">
                        <a href="/home/detail/{{$v->id}}.html">
                            <img class="img-responsive " src="{{$v->path}}" alt="">
                        </a>
                    </div>
                    <div class=" fashion-grid1">
                        <h6 class="best2">
                            <a href="/home/detail/{{$v->id}}.html">
                                {!!$v->title!!}
                            </a>
                        </h6>
                        <span class=" price-in1">
                            {{$v->price}}
                        </span>
                    </div>
                    <div class="clearfix">
                    </div>
                </div>
                @endforeach
            </div>
            </div>
		 <script type="text/javascript">
         $(function () {
	            // 获取广告div的高度
	            var divheight = $('#fixed_side').height();
	            var footertop = $(".footer").offset().top;
	            var H = footertop - divheight;
	            var dtop = $("#fixed_side").offset().top;
	            $(window).scroll(function()
	            {
	                var top = $(window).scrollTop();
	                
	                 if(top >= dtop){
	         			$('#fixed_side').css({'position':'fixed','right':'30px'});
	                	 if(top >= H){
	                   		 $('#fixed_side').css({'position':'absolute','top':H+'px','right':'0px'});     
	            		}else{
	             			$('#fixed_side').css({'position':'fixed','right':'30px','top':'20px'});
	                	}    
	                }else if(top <= dtop ){  
	                    $('#fixed_side').css({'position':'','right':'0px'});
	                }
	            });           
            });


        </script>

<!--//seller-->
<!--tag-->
		

		<div class="clearfix"> </div>
	</div>
</div>
<!--//content-->	
@endsection